package com.dao;

import com.entity.Td_tblPartyOrgbranchApprove;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface Td_tblPartyOrgbranchApproveDao extends JpaRepository<Td_tblPartyOrgbranchApprove,Integer> {

    /**
     * 根据审批的组织查询该组织的审批日志
     * @param branchId 组织id
     * @param pageable
     * @return 0=id     1=被审批组织id       2=不通过原因
     */
    @Query(value = "select fd_id,fd_beBranchName,fd_reason from td_tblPartyOrgbranchApprove where fd_branchId=? and fd_beBranchName like ?",nativeQuery = true)
    public List<Object[]> getBeBranchByFd_branchId(int branchId,String branchName, Pageable pageable);
}
